<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../lib/vue.js"></script>
    <script src="../lib/vue-router.js"></script>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .header {
            background-color: pink;
            height: 100px;
        }
        .container {
            display: flex;
        }
        .left {
            height: 500px;
            background-color: skyblue;
            flex: 2;
        }
        .main{
            height: 500px;
            background-color: purple;
            flex: 8;
        }
    </style>
</head>
<body>
    <div id="app">
        <router-view class="header"></router-view>
        <div class="container">
            <router-view  name="left" class="left"></router-view>
            <router-view  name="main" class="main"></router-view>
        </div>
    </div>
    <script>
        var header = {
            template:"<h1>头部</h1>"
        }
        var leftBox = {
            template:"<h1>左侧</h1>"
        }
        var mainBox = {
            template:"<h1>主体部分</h1>"
        }
        var router = new VueRouter({
            routes:[
                {
                    // 得加s  传入的是 组件群
                    path:'/',components:{
                        // default 是默认第一个
                        "default":header,
                        "left":leftBox,
                        "main":mainBox
                    }
                }
            ]
        })
        var vm = new Vue({
            el:"#app",
            data:{

            },
            methods:{

            },
            router
        }) 
    </script>
</body>
</html>